package com.skyblue.relation.action;

import java.util.Date;

import com.opensymphony.xwork2.ActionSupport;
import com.skyblue.relation.domain.Department;
import com.skyblue.relation.domain.Employee;
import com.skyblue.relation.service.EmployeeService;

public class AddEmployee  extends ActionSupport{
	private String name;
	private String password;
	private Date hireDate;
	private String position;
	private String cellphone;
	private String email;
	private String contractNo;
	private String privilege;
	private Department department;
	private EmployeeService employeeService;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}

	public Date getHireDate() {
		return hireDate;
	}
	public void setHireDate(Date hireDate) {
		this.hireDate = hireDate;
	}
	public String getPosition() {
		return position;
	}
	public void setPosition(String position) {
		this.position = position;
	}
	public String getCellphone() {
		return cellphone;
	}
	public void setCellphone(String cellphone) {
		this.cellphone = cellphone;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getContractNo() {
		return contractNo;
	}
	public void setContractNo(String contractNo) {
		this.contractNo = contractNo;
	}
	public String getPrivilege() {
		return privilege;
	}
	public void setPrivilege(String privilege) {
		this.privilege = privilege;
	}
	public Department getDepartment() {
		return department;
	}
	public void setDepartment(Department department) {
		this.department = department;
	}
	public EmployeeService getEmployeeService() {
		return employeeService;
	}
	public void setEmployeeService(EmployeeService employeeService) {
		this.employeeService = employeeService;
	}
	
	public String execute()  {
		System.out.println("实例化员工");
		Employee employee = new Employee();
		employee.setName(name);
		employee.setPassword(password);
		employee.setCellphone(cellphone);
		employeeService.addEmployee(employee);
		return SUCCESS;
	}
}
